#include <bits/stdc++.h>
#define gc getchar
#define pc putchar
#define pt printf
#define IL inline
#define For(i,a,b) for(int i=a;i<=b;++i)
#define Rof(i,a,b) for(int i=a;i>=b;++i) 
using namespace std;
const int Mxn=2e5+5;
int N,L,Ans,A[Mxn],B[Mxn],F[Mxn];
int _() {
	int x=0,f=0;char ch=gc();
	while(ch<'0'||ch>'9') f|=(ch=='-'),ch=gc();
	while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+(ch^48),ch=gc();
	return f?-x:x;
}
void __(int x) {
	int stk[30],tp=0;
	if(x<0) x=-x,pc('-');
	do stk[++tp]=x%10,x/=10;while(x);
	while(tp) pc(stk[tp--]^48);
}
void DFS(int x,int l,int s) {
//	pt("[%d %d %d]\n",x,l,s);
	if(x>N) {if(l<=L) Ans=max(Ans,s);return ;}
	DFS(x+1,l^A[x],s^B[x]);
	DFS(x+1,l,s);
}
signed main() {//20
	freopen("lock.in","r",stdin);
	freopen("lock.out","w",stdout);
	N=_(),L=_();
	if(N<=18) {
		For(i,1,N) A[i]=_(),B[i]=_();
		DFS(1,0,0);
		__(Ans);
	}
	else {
		For(i,1,N) {
			int a=_(),b=_();
			For(k,0,L) {
				if((k^a)>L) continue;
				F[k^a]=max(F[k^a],F[k]^b);
			}
		}
		For(k,0,L) Ans=max(Ans,F[k]);
		__(Ans);
	}
	return 0;
}
